﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;

namespace Huayou.UI.WebControls
{
	public class Alert:System.Web.UI.WebControls.WebControl
	{
        private Page page;

        public Alert(Page page)
        {
            this.page = page;
        }

        public Alert()
        {
            this.page = (Page)this.Context.CurrentHandler;
        }
        
        public void Show(string message)
        {
            String contentInfo = string.Format("alert({0});", message);
            this.page.ClientScript.RegisterStartupScript(this.GetType(), contentInfo, contentInfo, true);
        }



        public void Response(string message)
        {
            string content = string.Format("<script type=\"text/javascript\">{0}</script>", message);
            this.Context.Response.Write(content);
        }
	}
}
